<!--
*Author：富行天下团队

 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/CommissionRules.js此处编写
 -->
<template>
    <div>
        <view-grid
                   ref="grid"
                   :columns="columns"
                   :detail="detail"
                   :editFormFields="editFormFields"
                   :editFormFileds="editFormFields"
                   :editFormOptions="editFormOptions"
                   :searchFormFields="searchFormFields"
                   :searchFormFileds="searchFormFields"
                   :searchFormOptions="searchFormOptions"
                   :table="table"
                   :extend="extend">
        </view-grid>
    </div>
</template>

<script>
    import extend from "@/extension/mall/CommissionRules.js";
    import ViewGrid from "@/components/basic/ViewGrid.vue";
    var vueParam = {
        components: {
            ViewGrid
        },
        data() {
            return {
                table: {
                    key: 'id',
                    footer: "Foots",
                    cnName: '佣金规则',
                    name: 'CommissionRules',
                    url: "/CommissionRules/",
                    sortName: "id"
                },
                extend: extend,
                editFormFields: {"goodName":"",goodCode:"","sharing_rules":"","money":"","proportion":""},
                editFormOptions: [[{"title":"商品名称","field":"goodName","type":"text",disabled: true, required: true}],
                [{"title":"商品编码","field":"goodCode","type":"text",disabled: true, required: true}],
                              [{"dataKey":"sharingRules","data":[],"title":"分佣规则 ","field":"sharing_rules","type":"radio"}],
                              [{"title":"金额","field":"money","type":"number",min: 0,hidden: true}],
                              [{"title":"比例","field":"proportion","type":"number",min: 0,max: 100,hidden: true}]],
                searchFormFields: {"goodName":"","sharing_rules":""},
                searchFormOptions: [[{"title":"商品名称","field":"goodName","type":"text"},{"dataKey":"sharingRules","data":[],"title":"分佣规则 ","field":"sharing_rules","type":"select"}]],
                columns: [{field:'id',title:'',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'},
                      {field:'goodName',title:'商品名称',type:'string',width:220,align:'left'},
                      {field:'goodCode',title:'商品编码',type:'string',width:220,align:'left'},
                    //    {field:'merchantCode',title:'商户编码',type:'string',width:220,align:'left'},
                      //  {field:'MerchantName',title:'供应商名称',type:'string',width:220,align:'left'},
                       {field:'sharing_rules',title:'分佣规则',type:'string',bind:{ key:'sharingRules',data:[]},width:220,align:'left'},
                       {field:'money',title:'金额',type:'decimal',width:90,align:'left'},
                       {field:'proportion',title:'比例',type:'decimal',width:90,align:'left'},
                      //  {field:'modifyID',title:'修改人ID',type:'int',width:90,hidden:true,align:'left'},
                      {field:'creator',title:'创建人',type:'string',width:80,align:'left'},
                      {field:'createDate',title:'创建时间',type:'datetime',width:190,align:'left',sortable:true},
                      //  {field:'createID',title:'创建人ID',type:'int',width:90,hidden:true,align:'left'},
                      {field:'modifier',title:'修改人',type:'string',width:80,align:'left',sortable:true},
                      {field:'modifyDate',title:'修改时间',type:'datetime',width:190,align:'left',sortable:true},],
                detail: {
                    cnName:"#detailCnName",
                    columns: [],
                    sortName: "",
                    key:""
                }
            };
        }
    };
    export default vueParam;
</script>
